package edu.hnui.shop.commons;

public enum ResultCodeEnum {
    //设置了全局的状态码
    SUCCESS(true,200200,"success"),
    LOGIN_SUCCESS(true,200101,"login success"),
    UNKNOWN_ERROR(false,400400,"unknown error"),
    NULL_POINT(false,400001,"null point error"),
    TELPHONE_OR_PWD_ERROR(false,400101,"手机号码或者密码错误"),
    LOGIN_FAIL(false,400111,"登录失败"),
    PARAMETER_VALIDATION_ERROR(false,4004002,"请求参数异常");

     ResultCodeEnum(boolean flag,Integer code,String message){
         this.code=code;
         this.flag=flag;
         this.message=message;
     }

    /**
     * 标识结果的状态，true:表示成功，false表示失败
     */
    private boolean flag;
    /**
     * 定义的业务编码 400100 表示用户名或者密码错误
     */
    private Integer code;
    /**
     * 响应的消息
     */
    private String message;

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
